<h1><%= "#{t(:listing)} #{t(:stocks)}" %></h1>

<table>
  <thead>
    <tr>
      <th><%= t :drug %></th>
      <th><%= t :inventory %></th>
      <th><%= t :quantity %></th>
      <th><%= t :created_at %></th>
      <th><%= t :updated_at %></th>
      <th><%= t :created_by %></th>
      <th><%= t :updated_by %></th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody>
    <% @stocks.each do |stock| %>
      <tr>
        <td><%= stock.drug_id %></td>
        <td><%= stock.inventory_id %></td>
        <td><%= stock.quantity %></td>
        <td><%= stock.created_at %></td>
        <td><%= stock.updated_at %></td>
        <td><%= stock.created_by %></td>
        <td><%= stock.updated_by %></td>
        <td><%= link_to "#{t(:show)}", stock %></td>
        <td><%= link_to "#{t(:edit)}", edit_stock_path(stock) %></td>
        <td><%= link_to "#{t(:destroy)}", stock, method: :delete, data: { confirm: 'Are you sure?' } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to "#{t(:new_stock)}", new_stock_path %>
